<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017\10\25 0025
 * Time: 18:00
 */

namespace app\api\model;


class Token
{
    protected $url = '' ;
    protected $appId = '' ;

    public function accessToken()
    {
        https://api.weixin.qq.com/cgi-bin/token?
        //grant_type=client_credential&appid=APPID&secret=APPSECRET
        $param = [
            'grant_type'=>'client_credential',
            'appid' => $this->appId,
            'secret' =>$this->secret
        ];
        $params= http_build_query($param) ;
        $url = $this->url.$param ;
        return curl($url) ;
    }
}